import request from '@/axios/request';
import url from '@/axios/url';
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}wmsInTaskDetail/export`
// 获取子表详情
export function getInfo (id = '') {
  return request({
    url: `${mesUrl}wmsInTaskDetail/info/${id}`,
    method: 'get'
  })
}
// 获取主表详情
export function getMasterInfo (id = '') {
  return request({
    url: `${mesUrl}wmsInTask/info/${id}`,
    method: 'get'
  })
}
//分页查询
export function getList(params = {}) {
  return request({
    url: `${mesUrl}wmsInTaskDetail`,
    method: 'get',
    params,
  });
}
//新增
export function rowCreate(data = {}) {
  return request({
    url: `${mesUrl}wmsInTaskDetail`,
    method: 'post',
    data,
  });
}
//修改
export function rowUpdate(data = {}) {
  return request({
    url: `${mesUrl}wmsInTaskDetail`,
    method: 'put',
    data,
  });
}
//删除
export function rowDel(id) {
  return request({
    url: `${mesUrl}wmsInTaskDetail/${id}`,
    method: 'put',
  });
}

// 查询单据类型列表
export function getOrderTypeList() {
  return request({
    url: `${adminUrl}dict/type/wms_in_order_type`,
    method: 'get',
  });
}
// 查询过账状态列表
export function getAccountingFlagList() {
  return request({
    url: `${adminUrl}dict/type/wms_accounting_flag`,
    method: 'get',
  });
}

// 获取仓库信息
export function getCurrentWarehouseCode() {
  return request({
    url: `${adminUrl}basic`,
    method: 'get',
  });
}

// 查询库区列表
export function getAreaCodeList(params = {}) {
  return request({
    url: `${adminUrl}baseArea/list`,
    method: "get",
    params,
  });
}

// 查询库位列表
export function getLocationCodeList(params = {}) {
  return request({
    url: `${adminUrl}baseLocation/list`,
    method: "get",
    params,
  });
}

// 查询单位列表
export function getUnitList() {
  return request({
    url: `${adminUrl}dict/type/units`,
    method: "get",
  });
}

export function getPushStatus() {
  return request({
    url: `${adminUrl}dict/type/wms_push_status`,
    method: "get",
  });
}

export function getLineStatus() {
  return request({
    url: `${adminUrl}dict/type/wms_order_line_status`,
    method: "get",
  });
}

export function getSnControl() {
  return request({
    url: `${adminUrl}dict/type/wms_sn_control`,
    method: "get",
  });
}

//分页查询待入库物料数据
export function waitInTaskDetail (params = {}) {
  return request({
    url: `${mesUrl}wmsKtInTaskDetail/waitInTaskDetail`,
    method: 'get',
    params,
  });
}
